home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sun Solutions 2000 #2
/
Sun Solutions CD (Volume 2 2000)(Special Focus - Java Technologies)(Disc 1).ISO
/
products
/
Software
/
Wind_River
/
_install
/
install.kit
< prev
next >
Wrap
Text File
|
2000-02-15
|
64KB
|
2,145 lines
#!/bin/csh -f
###############################################################################
#
# SNiFF+ INSTALLATION
#
###############################################################################
#
# SNiFF+ 3.X installation procedure
# Copyright (c) 1999 TakeFive Software GmbH
# All rights reserved.
#
# This software has been provided pursuant to a License Agreement
# containing restrictions on its use. This software contains
# valuable trade secrets and proprietary information of
# TakeFive Software GmbH and is protected by law. It may
# not be copied or distributed in any form or medium, disclosed
# to third parties, reverse engineered or used in any manner not
# provided for in said License Agreement except with the prior
# written authorization from TakeFive Software GmbH.
#
# The size of the package is calculated with KB = gzip size/975
# This is 5% more space for save installing
###############################################################################
#set verbose = 1
set SNiFFversion = '3.2'
set nonomatch = 1
set no_perm = 0
set kitroot = `pwd`
set same_version = 0
#################################### versions #################################
set gccversion = '2.7.2.2'
set gdbversion = '4.16'
set rcsversion = '5.7'
set mk_version = '3.74'
set libgversion = '2.7.2'
set jdkversion = '1.1.1'
################################ default values ###############################
set gnudir = '/usr/local'
set nl_zcat = ("gzcat." "gzcat" "GZCAT" "GZCAT." "GZCAT.;1")
set nl_tar = ("tar." "tar" "TAR" "TAR." "TAR.;1")
################################ package sizes ################################
set size_SNiFF = 0
set size_common_SNiFF = 0
set size_doc = 0
set size_com_exa = 0
set size_bin_exa = 0
set size_gcc = 0
set size_libg = 0
set size_gdb = 0
set size_rcs = 0
set size_mk = 0
set size_bin_vim = 0
set size_visaj = 0
################################ filenames ###################################
set nl_install = ("install.kit" "INSTALL.KIT" "INSTALL.KIT;1")
set nl_sundir = ("sunos" "SUNOS" "SUNOS")
set sundir = "sparc-sun-sunos4.1"
set nl_solarisdir = ("solaris" "SOLARIS" "SOLARIS")
set solarisdir = "sparc-sun-solaris2.3"
set nl_hpriscdir = ("hpux" "HPUX" "HPUX")
set hpriscdir = "pa_risc-hp-hpux10"
set nl_osfdir = ("osf" "OSF" "OSF")
set osfdir = "alpha-dec-osf3.0"
set nl_ibmrsdir = ("aix" "AIX" "AIX")
set ibmrsdir = "rs6000-ibm-aix4.2"
set nl_irixdir = ("irix" "IRIX" "IRIX")
set irixdir = "mips-sgi-irix5.3"
set nl_scodir = ("sco" "SCO" "SCO")
set scodir = "i386-unknown-sco3.2v4.2"
set nl_linux_rh_dir = ("linux-glibc" "LINUX-GLIBC" "LINUX-GLIBC")
set linux_rh_dir = "i586-linux-glibc"
set nl_usldir = ("unixware" "UNIXWARE" "UNIXWARE")
set usldir = "i386-unknown-unixware7"
set nl_ncrdir = ("ncr" "NCR" "NCR")
set ncrdir = "i386-ncr-sysv4.0"
set nl_sinixdir = ("sinix" "SINIX" "SINIX")
set sinixdir = "mips-sni-sinix5.42"
set nl_sniffbin = ("sniffbin.tgz" "SNIFFBIN.TGZ" "SNIFFBIN.TGZ;1")
set nl_sniffcommon = ("sniff.tgz" "SNIFF.TGZ" "SNIFF.TGZ;1")
set nl_gccbin = ("gccbin.tgz" "GCCBIN.TGZ" "GCCBIN.TGZ;1")
set nl_gdbbin = ("gdbbin.tgz" "GDBBIN.TGZ" "GDBBIN.TGZ;1")
set nl_rcsbin = ("rcsbin.tgz" "RCSBIN.TGZ" "RCSBIN.TGZ;1" )
set nl_mk_bin = ("mk_bin.tgz" "MK_BIN.TGZ" "MK_BIN.TGZ;1" )
set nl_libgarchive = ("libg.tgz" "LIBG.TGZ" "LIBG.TGZ;1")
set nl_vimbin = ("vimbin.tgz" "VIMBIN.TGZ" "VIMBIN.TGZ;1")
set nl_copy = ("copy.txt" "COPY.TXT" "COPY.TXT;1")
set nl_copylib = ("copylib.txt" "COPYLIB.TXT" "COPYLIB.TXT;1")
set nl_examples = ("example.tgz" "EXAMPLE.TGZ" "EXAMPLE.TGZ;1")
set nl_docfiles = ("doc.tgz" "DOC.TGZ" "DOC.TGZ;1")
set nl_gnusrcdir = ("gnusrc" "GNUSRC" "GNUSRC")
set nl_gcc = ("gccsrc.tgz" "GCCSRC.TGZ" "GCCSRC.TGZ;1")
set nl_gdb = ("gdbsrc.tgz" "GDBSRC.TGZ" "GDBSRC.TGZ;1")
set nl_libg = ("libgsrc.tgz" "LIBGSRC.TGZ" "LIBGSRC.TGZ;1")
set nl_rcs = ("rcssrc.tgz" "RCSSRC.TGZ" "RCSSRC.TGZ;1")
set nl_mk = ("mk_src.tgz" "MK_SRC.TGZ" "MK_SRC.TGZ;1")
set nl_jdkdir = ("jdk" "JDK" "JDK")
set nl_jdk = ("jdk111.tgz" "JDK111.tgz" "JDK111.tgz;1")
set nl_visaj = ("visaj.tgz" "VISAJ.TGZ" "VISAJ.TGZ;1")
set visajdir = "Visaj"
# FTP Package names e.g. sco-sniff.tar solaris-sniff.tgz
set nl_sniff_package = "sniff.tar"
set nl_gnubin_package = "gnubin.tar"
set nl_gnusrc_package = "gnusrc.tar"
# FlexLM file names
set flex_files = (lmutil lmdown lmgrd lmhostid lmremove lmreread lmstat lmver takefive)
#
set pid = $$
set tmp_script = "/tmp/.scantar.$pid"
set tmperr = "/tmp/.stderrout.$pid"
set common_install = 0
set visaj_install = 0
set bin_install = 0
set doc_install = 0
set exa_install = 0
set vim_bin_install = 0
set sniff_avail = 0
set sniff_avails = ()
set one_sniff_avail = 0
set gnubin_avail = 0
set gnusrc_avail = 0
if ($?user == 0) then
if ($?USER == 0) then
echo "Please enter your user name: " | awk ' { printf "%s", $0 }'
set user = `/bin/sh -c 'read a; echo $a'`
if ("$user" == "") then
goto quit
endif
else
set user = $USER
endif
endif
#
# Check kit, get name format
#
@ iname = 1
foreach i ($nl_install)
if ( -f ./$i ) then
break
endif
@ iname = $iname + 1
end
if ( "$iname" > "3" ) then
echo "Your current working directory doesn't contain the file install.kit"
echo "Please change to the directory containing the SNiFF+ packages and try again."
echo ""
goto quit
endif
start_install:
clear
echo ""
echo " SNiFF+ $SNiFFversion installation procedure"
echo " Copyright (c) 1993-1999 TakeFive Software GmbH."
echo " All rights reserved."
select_installation:
echo ""
echo "Please select:"
echo ""
echo " [A] Install SNiFF+ binaries"
echo " [B] Install GNU binaries"
echo " [C] Install FlexLM binaries"
echo ""
echo " [X] Exit installation"
echo ""
echo "Your selection: " | awk '{ printf "%s", $0 }'
set selection = `/bin/sh -c 'read a; echo $a'`
switch("$selection")
case [aA]*:
set selection = 1
breaksw
case [bB]*:
set selection = 2
breaksw
case [cC]*:
set selection = 3
breaksw
case [xX]*:
goto quit
breaksw
default:
goto select_installation
endsw
set kitdirs = ()
set kit_archs = ()
set iarchs = ()
set selected = ()
set iarch = 1
# SOLARIS_ONLY
if ($selection >= 1) then
set kitdirs = ($nl_solarisdir[$iname])
set kit_archs = $solarisdir
set iarchs = 1
set instdir = $nl_solarisdir[$iname]
set inst_arch = $solarisdir
switch (`uname -m`@`uname -s`@`uname -r`)
case sun4*@SunOS@5.*:
goto end_ask_platform
breaksw
default:
echo ""
echo "You need to install this package on solaris."
echo ""
exit 1
endsw
endif
if ($selection > 1) goto enter_install_platform
echo ""
echo ""
echo "SNiFF+ can be installed for multiple platforms in one directory. It is also"
echo "possible to install a SNiFF+ kit for a platform which is not the installation"
echo "platform. Therefore, please select first the target platforms"
echo "and then the installation platform."
echo ""
enter_platform:
echo ""
echo "Enter the platform(s) for which you want to install SNiFF+:"
echo ""
echo "sunos for Sun SPARC machines running SunOS4 (Solaris 1.x)"
echo "solaris for Sun SPARC machines running SunOS5 (Solaris 2.x)"
echo "aix for IBM Risc machines running AIX 4.x"
echo "hpux for HP 9000/7XX machines running HP-UX 10.x/11.x"
echo "decalpha for DEC/alpha machines running Digital UNIX 3.x/4.x"
echo "irix for SGI machines running IRIX 5.3 or later"
echo "unixware for PC's running SCO Unixware 7.x/2.x or OpenServer 5.x"
echo "linux-glibc for PC's running Linux 2.x based on GNU glibc 2.1 (like RedHat 6.x)"
echo "sinix for SNI RM machines running Reliant Unix 5.4x"
echo ""
echo "Enter one name at a time (Leave empty to finish the selection)."
echo ""
set end = 0
while (! $end)
echo "Target platform number $iarch : " | awk ' { printf "%s", $0 }'
set platform = `/bin/sh -c 'read a; echo $a'`
@ plus = 1
switch("$platform")
case quit:
goto quit
case sunos:
set kitdirs = ($kitdirs $nl_sundir[$iname])
set kit_archs = ($kit_archs $sundir)
breaksw
case solaris:
set kitdirs = ($kitdirs $nl_solarisdir[$iname])
set kit_archs = ($kit_archs $solarisdir)
breaksw
case hpux:
set kitdirs = ($kitdirs $nl_hpriscdir[$iname])
set kit_archs = ($kit_archs $hpriscdir)
breaksw
case decalpha:
set kitdirs= ($kitdirs $nl_osfdir[$iname])
set kit_archs = ($kit_archs $osfdir)
breaksw
case aix:
set kitdirs= ($kitdirs $nl_ibmrsdir[$iname])
set kit_archs = ($kit_archs $ibmrsdir)
breaksw
case irix:
set kitdirs= ($kitdirs $nl_irixdir[$iname])
set kit_archs = ($kit_archs $irixdir)
breaksw
case sco:
set kitdirs= ($kitdirs $nl_scodir[$iname])
set kit_archs = ($kit_archs $scodir)
breaksw
case linux-glibc:
set kitdirs= ($kitdirs $nl_linux_rh_dir[$iname])
set kit_archs = ($kit_archs $linux_rh_dir)
breaksw
case unixware:
set kitdirs= ($kitdirs $nl_usldir[$iname])
set kit_archs= ($kit_archs $usldir)
breaksw
case sinix:
set kitdirs= ($kitdirs $nl_sinixdir[$iname])
set kit_archs= ($kit_archs $sinixdir)
breaksw
case ncr:
set kitdirs= ($kitdirs $nl_ncrdir[$iname])
set kit_archs= ($kit_archs $ncrdir)
breaksw
default:
if ("$platform" == "") then
if ("$kitdirs" == "") then
echo ""
echo "Please select at least one platform."
echo "Enter 'quit' to exit Installation."
echo ""
else
set end = 1
endif
else
echo ""
echo "You have selected an invalid platform name: $platform"
echo "Please retry"
echo ""
endif
set plus = 0
breaksw
endsw
if ($plus == 1) then
set iarchs = ($iarchs $iarch)
set selected = ($selected $platform)
endif
@ iarch = $iarch + $plus
end
if ("$kitdirs" == "") then
echo ""
echo "Please select at least one platform."
echo ""
goto enter_platform
endif
echo ""
echo ""
echo "The following platforms have been selected for installation:"
echo ""
foreach iarch ($iarchs)
echo " $selected[$iarch]"
end
echo ""
echo "Selection OK [y]? " | awk ' { printf "%s", $0 }'
set cmsg = `/bin/sh -c 'read a; echo $a'`
if ("$cmsg" == "") then
set cmsg = "y"
endif
switch("$cmsg")
case [nN]*:
goto enter_platform
endsw
set imsg = $selected[1]
enter_install_platform:
if (! $?imsg) then
set imsg = ""
endif
echo ""
echo ""
echo "Install from one of the following platforms:"
echo ""
echo "sunos for Sun SPARC machines running SunOS4 (Solaris 1.x)"
echo "solaris for Sun SPARC machines running SunOS5 (Solaris 2.x)"
echo "aix for IBM Risc machines running AIX 4.x"
echo "hpux for HP 9000/7XX machines running HP-UX 10.x/11.x"
echo "decalpha for DEC/alpha machines running Digital UNIX 3.x/4.x"
echo "irix for SGI machines running IRIX 5.3 or later"
echo "unixware for PC's running SCO Unixware 7.x/2.x or OpenServer 5.x"
echo "linux-glibc for PC's running Linux 2.x based on GNU glibc 2.1 (like RedHat 6.x)"
echo "sinix for SNI RM machines running Reliant Unix 5.4x"
echo ""
echo "Which one is your installation platform [$imsg]? " | awk ' { printf "%s", $0 }'
set cmsg = `/bin/sh -c 'read a; echo $a'`
if ( "$cmsg" == "" ) then
set cmsg = $imsg
endif
switch ("$cmsg")
case sunos:
set instdir = $nl_sundir[$iname]
set inst_arch = $sundir
breaksw
case solaris:
set instdir = $nl_solarisdir[$iname]
set inst_arch = $solarisdir
breaksw
case hpux:
set instdir = $nl_hpriscdir[$iname]
set inst_arch = $hpriscdir
breaksw
case decalpha:
set instdir = $nl_osfdir[$iname]
set inst_arch = $osfdir
breaksw
case aix:
set instdir = $nl_ibmrsdir[$iname]
set inst_arch = $ibmrsdir
breaksw
case irix:
set instdir = $nl_irixdir[$iname]
set inst_arch = $irixdir
breaksw
case sco:
set instdir = $nl_scodir[$iname]
set inst_arch = $scodir
breaksw
case linux-glibc:
set instdir = $nl_linux_rh_dir[$iname]
set inst_arch = $linux_rh_dir
breaksw
case unixware:
set instdir = $nl_usldir[$iname]
set inst_arch = $usldir
breaksw
case sinix:
set instdir = $nl_sinixdir[$iname]
set inst_arch = $sinixdir
breaksw
case ncr:
set instdir = $nl_ncrdir[$iname]
set inst_arch = $ncrdir
breaksw
default:
echo ""
echo "You have selected an invalid platform name."
echo ""
goto enter_install_platform
endsw
# SOLARIS_ONLY
end_ask_platform:
set path = ($kitroot/$instdir $path)
cd $kitroot
if ($selection == 2) goto test_gnu_package
if ("$iarchs" == "") then
set iarchs = (1)
set kit_archs = ($inst_arch)
set kitdirs = ($instdir)
endif
# use vanilla tar of system
# extract tar from package (if available)
set one_vim_avail = 0
foreach iarch ($iarchs)
set kitdir = $kitdirs[$iarch]
set kit_arch = $kit_archs[$iarch]
set sniff_avail = 0
if ( -f ./$kitdir/$nl_sniffbin[$iname] ) then
set sniff_avail = 1
else
if ( -f ./$kitdir-$nl_sniff_package ) then
set sniff_avail = 1
echo ""
echo "Preparing package: SNiFF+ for $kit_arch"
echo "This may take several minutes, depending on your machine."
if (! -f $instdir/tar) then
tar -xf ./$instdir-$nl_sniff_package $instdir/tar >& /dev/null
endif
if ( -f $instdir/tar) then
$instdir/tar -xo --exclude $instdir/tar -f ./$kitdir-$nl_sniff_package > /dev/null
else
tar -xopf ./$kitdir-$nl_sniff_package > /dev/null
endif
else
echo ""
echo "Your current working directory doesn't contain SNiFF+ for $kit_arch."
echo "There must be a subdirectory '$kitdir' in your current working directory."
echo "If you are installing from tape, then you must copy the directory '$kitdir'"
echo "from the tape."
echo ""
endif
endif
set vim_avail = 0
if ($sniff_avail && (-f ./$kitdir/$nl_vimbin[$iname])) then
set vim_avail = 1
endif
set sniff_avails = ($sniff_avails $sniff_avail)
@ one_sniff_avail = ($one_sniff_avail || $sniff_avail)
@ one_vim_avail = ($one_vim_avail || $vim_avail)
end
set visaj_avail = 0
if (-f ./$nl_visaj[$iname]) then
set visaj_avail = 1
endif
goto get_gzcat
# check GNU and JDK packages
test_gnu_package:
set gnubin_avail = 0
if ( -f ./$instdir/$nl_gccbin[$iname] ) then
set gnubin_avail = 1
else
if ( -f ./$instdir-$nl_gnubin_package ) then
set gnubin_avail = 1
echo ""
echo "Preparing package: GNU binaries for $inst_arch"
echo "This may take several minutes, depending on your machine."
if (! -f $instdir/tar) then
tar -xf ./$instdir-$nl_gnubin_package $instdir/tar >& /dev/null
endif
if ( -f $instdir/tar) then
./$instdir/tar -xo --exclude $instdir/tar -f ./$instdir-$nl_gnubin_package > /dev/null
else
tar -xopf ./$instdir-$nl_gnubin_package > /dev/null
endif
else
echo ""
echo "Your current working directory doesn't contain binaries of GNU"
echo "gcc-$gccversion, gdb-$gdbversion, libg++-$libgversion, rcs-$rcsversion"
echo "and make-$mk_version for $inst_arch."
echo ""
endif
endif
if ( -f ./$nl_gnusrcdir[$iname]/$nl_gcc[$iname] ) then
set gnusrc_avail = 1
else
if ( -f ./$nl_gnusrc_package ) then
set gnusrc_avail = 1
echo ""
echo "Preparing package: GNU sources."
echo "This may take several minutes, depending on your machine."
if ( -f $instdir/tar) then
./$instdir/tar -xopf ./$nl_gnusrc_package > /dev/null
else
tar -xopf ./$nl_gnusrc_package > /dev/null
endif
# else
# echo ""
# echo "Your current working directory doesn't contain GNU source packages"
# echo "of gcc-$gccversion, gdb-$gdbversion, libg++-$libgversion, rcs-$rcsversion, make-$mk_version."
# echo ""
endif
endif
set jdk_avail = 0
if (-f ./$nl_jdkdir[$iname]/$instdir/$nl_jdk[$iname]) then
set jdk_avail = 1
endif
get_gzcat:
# check for gzcat and tar
# search again format list
@ gname = 1
foreach i ($nl_zcat)
if ( -f $kitroot/$instdir/$i ) then
break
endif
@ gname = $gname + 1
end
if ( "$gname" > $#nl_zcat ) then
@ gname = 2
set gz = $nl_zcat[$gname]
else
set gz = $kitroot/$instdir/$nl_zcat[$gname]
endif
$gz -h >& /dev/null
if ( $status != 0 ) then
if ( -f $kitroot/$instdir/$nl_zcat[$gname] ) then
chmod 755 $kitroot/$instdir/$nl_zcat[$gname] >& /dev/null
if ( ! -x $kitroot/$instdir/$nl_zcat[$gname] ) then
echo ""
echo Cannot set execute permission on $kitroot/$instdir/$nl_zcat[$gname]
echo This program is needed to uncompress the patch.
echo Please set execute permission on that program and then
echo restart this script.
goto quit
endif
else
# no gzcat found anywhere
echo ""
echo "$nl_zcat[$gname] could not be found in the path or in $kitroot/$instdir/."
echo "This program is needed to uncompress the patch. You may download a precompiled"
echo "version from our FTP server as described in the README file."
goto quit
endif
endif
# search again the correct tar
@ gname = 1
foreach i ($nl_tar)
if ( -f $kitroot/$instdir/$i ) then
break
endif
@ gname = $gname + 1
end
if ( "$gname" > $#nl_tar ) then
@ gname = 2
endif
if ( -f $kitroot/$instdir/$nl_tar[$gname] ) then
chmod 755 $kitroot/$instdir/$nl_tar[$gname] >& /dev/null
if ( ! -x $kitroot/$instdir/$nl_tar[$gname] ) then
set gtar=$nl_tar[2]
else
set gtar=$kitroot/$instdir/$nl_tar[$gname]
endif
else
set gtar=$nl_tar[2]
endif
if ($selection == 2) goto select_gnu
if ($selection == 3) goto install_flexlm
select_sniff:
if ( $one_sniff_avail == 0) then
echo ""
echo "Your current working directory doesn't contain packages to install."
echo "Please change to the directory containing the SNiFF+ packages and try again."
echo ""
goto quit
endif
echo ""
echo "This procedure will install SNiFF+ for:"
echo ""
foreach iarch ($iarchs)
if ( $sniff_avails[$iarch] ) then
echo " $kit_archs[$iarch]"
endif
end
echo ""
echo "You will have to enter the full pathname of the directory where SNiFF+"
echo "should be installed in. If the directory does not exist then the procedure"
echo "will create it. The following packages are included on the media:"
echo ""
if ( $one_sniff_avail ) then
echo " - SNiFF+ $SNiFFversion core product"
endif
if ( $visaj_avail ) then
echo " - VisaJ GUI Builder for SNiFF+J"
endif
if (-f ./$nl_docfiles[$iname]) then
echo " - SNiFF+ documentation in PostScript format"
endif
if ( $one_sniff_avail ) then
echo " - Example sources for the tutorials including ET++"
endif
if ( $one_vim_avail ) then
echo " - Vim 5.0 Vi Improved by Bram Moolenar"
endif
#################### Check installation environment ###########################
#
# Define root directory
#
get_rootdir:
echo ""
echo 'Please enter the absolute pathname of the SNiFF+ root directory:'
echo ""
echo '> ' | awk ' { printf "%s", $0 }'
set rootdir = `/bin/sh -c 'read a; echo $a'`
echo ""
if ("$rootdir" == "") then
echo "You must specify the directory where SNiFF+ is to be located."
goto get_rootdir
endif
if ( `echo $rootdir | awk '{printf "%s",substr($1,1,1)}'` != "/" ) then
echo "Please enter an absolute pathname like /usr/SNiFF ..."
goto get_rootdir
endif
echo "Install SNiFF+ in directory $rootdir? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
goto get_rootdir
endsw
if ( "$rootdir" == "/" ) then
# some shells dont like it
set tmprootdir = '/.'
else
set tmprootdir = $rootdir
endif
if ( !(-d $tmprootdir) ) then
echo "$rootdir does not exist. Would you like to create it? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
goto get_rootdir
default:
mkdir -p $rootdir
chmod 755 $rootdir
if (!(-d $rootdir)) then
echo "Could not create $rootdir (maybe missing permission?), please try again."
goto quit
endif
endsw
endif
#
# check write permission on rootdir
#
touch $rootdir/t_e_s_t >& /dev/null
if ( !(-f $rootdir/t_e_s_t) ) then
echo ""
echo "You do not have write permission on $rootdir."
echo ""
goto quit
endif
/bin/rm $rootdir/t_e_s_t >& /dev/null
#################################################################################
# Customize SNiFF+ #
#################################################################################
echo ""
echo "You will be asked for each single package whether you would like to install it."
echo "After displaying the size of the software selected for loading,"
echo "the procedure will install the packages, which takes several minutes."
echo "If you are installing as superuser, then you will be asked for the name"
echo "and the group of the user who should be the owner of the current installation."
set common_overwrite = 0
set common_asked = 0
set visaj_asked = 0
set exa_asked = 0
set doc_asked = 0
set one_bin_install = 0
set one_vim_install = 0
set l_bin_install = ()
set l_vim_bin_install = ()
set l_bin_size = ()
set l_vim_bin_size = ()
foreach iarch ($iarchs)
set bin_install = 0
set vim_bin_install = 0
set size_SNiFF = 0
set size_bin_exa = 0
set size_bin_vim = 0
set kitdir = $kitdirs[$iarch]
set kit_arch = $kit_archs[$iarch]
echo ""
echo ""
echo "=========================================================================="
echo " Select packages for target platform: $kit_arch"
echo "=========================================================================="
if ((-f $kitroot/$nl_sniffcommon[$iname]) && (-f $kitroot/$kitdir/$nl_sniffbin[$iname])) then
set size_common_SNiFF = `$gz -l < $kitroot/$nl_sniffcommon[$iname] | fgrep stdout | awk '{printf ("%d", $2/975)}'`
set size_SNiFF = `$gz -l < $kitroot/$kitdir/$nl_sniffbin[$iname] | fgrep stdout | awk '{printf ("%d", $2/975)}'`
set size = "$size_SNiFF KB"
if (! $common_asked) then
set size = "$size_common_SNiFF KB + $size"
endif
ask_for_bin:
set empty = ""
echo ""
echo ""
echo "The media contains SNiFF+ $SNiFFversion for your system ($kit_arch)."
echo "Would you like to install it in $rootdir ($size)? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
set bin_install = '0'
breaksw
case [yY]*:
if ( ! $common_asked ) set common_install = 1
set bin_install = '1'
breaksw
default:
goto ask_for_bin
endsw
if (-f $rootdir/Version) then
set SNIFF_VER = `cat $rootdir/Version`
else
set SNIFF_VER = SNiFF+
endif
if ((! $common_asked) && ("$common_install" == '1') && (-f $rootdir/bin/sniff)) then
echo "Common part of $SNIFF_VER is already installed in directory $rootdir."
echo "Would you like to overwrite it? [n] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "n"
switch("$c")
case [yY]*:
set common_overwrite = 1
breaksw
default:
set common_install = '0'
endsw
if (-f $rootdir/Version) then
set version_in_file=`cat $rootdir/Version|cut -d" " -f2`
if ( "$SNiFFversion" == "$version_in_file") then
set same_version = 1
endif
endif
endif
set common_asked = 1
if (("$bin_install" == '1') && (-f $rootdir/bin/bin.$kit_arch/sniff)) then
echo "Binary part of $SNIFF_VER is already installed in directory $rootdir."
echo "Would you like to overwrite the $kit_arch binaries? [n] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "n"
switch("$c")
case [yY]*:
set bin_install = 2 # means: overwrite existing installation
breaksw
default:
set bin_install = '0'
endsw
endif
endif
#################################### VisaJ ##################################
if ( ( ! $visaj_asked ) && ( -f $kitroot/$nl_visaj[$iname] ) ) then
set size_visaj = `$gz -l < $kitroot/$nl_visaj[$iname] | fgrep stdout | awk '{printf ("%d", $2/975)}'`
ask_for_visaj:
echo ""
echo ""
echo "=========================================================================="
echo "The media contains"
echo " VisaJ GUI Builder for SNiFF+J"
echo ""
echo "This tool is part of SNiFF+J."
echo ""
set size = "$size_visaj KB"
echo "Install the files in $rootdir/$visajdir ($size)? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
set visaj_install = 0
breaksw
case [yY]*:
if ( ! $visaj_asked ) set visaj_install = 1
breaksw
default:
goto ask_for_example
endsw
if ( ("$visaj_install" == '1') && (-d $rootdir/$visajdir)) then
echo "VisaJ GUI Builder is already installed in $rootdir/$visajdir"
echo "Would you like to overwrite it? [n] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "n"
switch("$c")
case [yY]*:
set visaj_install = 2
breaksw
default:
set visaj_install = '0'
endsw
endif
set visaj_asked = 1
endif
##################################### Examples ##################################
if ( ( ! $exa_asked ) && ( -f $kitroot/$nl_examples[$iname] ) ) then
set size_com_exa = `$gz -l < $kitroot/$nl_examples[$iname] | fgrep stdout | awk '{printf ("%d", $2/975)}'`
ask_for_example:
set empty = ""
echo ""
echo ""
echo "=========================================================================="
echo "The media contains"
echo " Example sources for the tutorials including ET++"
echo ""
echo "These files are optional for using SNiFF+. They are needed only"
echo 'for working through the tutorials.'
echo "This unsupported software is provided on an AS IS basis."
echo ""
set size = "$size_com_exa KB"
echo "Install the files in $rootdir/example ($size)? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
set exa_install = 0
breaksw
case [yY]*:
if ( ! $exa_asked ) set exa_install = 1
breaksw
default:
goto ask_for_example
endsw
if ( ("$exa_install" == '1') && (-f $rootdir/example/c++/filebrowser/filebrowser.C)) then
echo "Common part of the SNiFF+ example is already installed in directory $rootdir."
echo "Would you like to overwrite it? [n] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "n"
switch("$c")
case [yY]*:
set exa_install = 2
breaksw
default:
set exa_install = '0'
endsw
endif
set exa_asked = 1
endif
##################################### VIM ##################################
if (-f $kitroot/$kitdir/$nl_vimbin[$iname]) then
set size_bin_vim = `$gz -l < $kitroot/$kitdir/$nl_vimbin[$iname] | fgrep stdout | awk '{printf ("%d", $2/975)}'`
ask_for_vim:
set empty = ""
echo ""
echo ""
echo "=========================================================================="
echo "The media contains the binaries for"
echo " Vim 5.0 (Vi Improved written by Bram Moolenar) -- vi like editor for SNiFF+"
echo ""
echo "These files are optional for using SNiFF+ and are not covered by the SNiFF+"
echo "Support Agreement."
echo ""
echo "Would you like to install the files in $rootdir ($size_bin_vim KB)? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
set vim_bin_install = '0'
breaksw
case [yY]*:
set vim_bin_install = '1'
breaksw
default:
goto ask_for_vim
endsw
if (("$vim_bin_install" == '1') && (-f $rootdir/bin/bin.$kit_arch/vim)) then
echo "Binary of the SNiFF+ vim is already installed in directory $rootdir."
echo "Would you like to overwrite the $kit_arch binaries? [n] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "n"
switch("$c")
case [yY]*:
set vim_bin_install = 2
breaksw
default:
set vim_bin_install = '0'
endsw
endif
endif
############################## Documentation ##################################
if (($doc_asked == 0) && (-f $kitroot/$nl_docfiles[$iname])) then
set size_doc = `$gz -l < $kitroot/$nl_docfiles[$iname] | fgrep stdout | awk '{printf ("%d", $2/975)}'`
ask_for_doc:
set empty = ""
echo ""
echo ""
echo "=========================================================================="
echo "The media contains the whole SNiFF+ documentation in compressed"
echo "PostScript format. The following documents are available:"
echo " Release Notes"
echo " Installation Guide"
echo " User's Guide"
echo " Reference Guide"
echo " Tutorials for C/C++/Java/Fortran"
echo ""
echo "Would you like to copy the files into $rootdir/doc ($size_doc KB)? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
set doc_install = '0'
breaksw
case [yY]*:
set doc_install = '1'
breaksw
default:
goto ask_for_doc
endsw
set doc_asked = 1
endif
clear
@ one_bin_install = ($one_bin_install || $bin_install)
@ one_vim_install = ($one_vim_install || $vim_bin_install)
set l_bin_install = ($l_bin_install $bin_install)
set l_vim_bin_install = ($l_vim_bin_install $vim_bin_install)
set l_bin_size = ($l_bin_size $size_SNiFF)
set l_vim_bin_size = ($l_vim_bin_size $size_bin_vim)
if ($iarch == 1) then
@ sumMBroot = 0
if ($common_install) then
@ sumMBroot = $sumMBroot + $size_common_SNiFF
endif
if ($exa_install) then
@ sumMBroot = $sumMBroot + $size_com_exa
endif
if ($doc_install) then
@ sumMBroot = $sumMBroot + $size_doc
endif
if ($visaj_install) then
@ sumMBroot = $sumMBroot + $size_visaj
endif
endif
if ($bin_install) then
@ sumMBroot = $sumMBroot + $size_SNiFF
endif
if ($vim_bin_install) then
@ sumMBroot = $sumMBroot + $size_bin_vim
endif
end # foreach ($iarch ...)
if ($sumMBroot == 0) then
goto quit
endif
@ sumMBroot = ($sumMBroot + 512) / 1024
echo ""
echo ""
echo "=========================================================================="
echo "The following packages are selected for installation:"
echo ""
if ($common_install) then
echo " Common SNiFF+ $SNiFFversion ($size_common_SNiFF KB)"
endif
if ($one_bin_install) then
echo " Binary SNiFF+ $SNiFFversion for:"
foreach iarch ($iarchs)
if ($l_bin_install[$iarch]) then
echo " $kit_archs[$iarch] ($l_bin_size[$iarch] KB)"
endif
end
endif
if ($visaj_install) then
echo " VisaJ GUI Builder for SNiFF+J ($size_visaj KB)"
endif
if ($doc_install) then
echo " SNiFF+ documentation in PostScript format ($size_doc KB)"
endif
if ($exa_install) then
echo " Example sources for the tutorials including ET++ ($size_com_exa KB)"
endif
if ($one_vim_install) then
echo " VIM binaries for:"
foreach iarch ($iarchs)
if ($l_vim_bin_install[$iarch]) then
echo " $kit_archs[$iarch] ($l_vim_bin_size[$iarch] KB)"
endif
end
endif
echo ""
echo "=========================================================================="
if ($sumMBroot != 0) echo "$sumMBroot MB to be installed in $rootdir"
goto ask_for_install
#
#################################################################################
# Customize GNU
#
#################################################################################
select_gnu:
if ( ($gnubin_avail == 0) && ($gnusrc_avail == 0) && ($jdk_avail == 0)) then
echo ""
echo "Your current working directory doesn't contain packages to install."
echo "Please change to the directory containing the GNU packages"
echo "and try again."
echo ""
goto quit
endif
echo "The following packages are included on the media:"
echo ""
if ( $gnubin_avail ) then
echo " - Binaries of GNU gcc-$gccversion, gdb-$gdbversion, libg++-$libgversion, rcs-$rcsversion"
echo " make-$mk_version"
endif
if ( $gnusrc_avail ) then
echo " - GNU source packages of gcc-$gccversion, gdb-$gdbversion, libg++-$libgversion, rcs-$rcsversion,"
echo " make-$mk_version"
endif
if ( $jdk_avail ) then
echo " - Java Development Kit (JDK)"
endif
echo ""
echo "You will be asked for each single package whether you would like to install it."
echo "After displaying the size of the software selected for loading,"
echo "the procedure will install the packages, which takes several minutes."
mkdir -p `dirname $gnudir` >& /dev/null
chmod 755 `dirname $gnudir` >& /dev/null
mkdir $gnudir >& /dev/null
chmod 755 $gnudir >& /dev/null
touch $gnudir/g_n_u_t_e_s_t >& /dev/null
if ((-d $gnudir) && !(-f $gnudir/g_n_u_t_e_s_t)) then
set no_perm = 1
echo ""
echo "WARNING: The GNU binaries supplied on the media (gcc,libg++,gdb,rcs,make)"
echo " must be installed in $gnudir on the local machine."
echo " You, "$user", do not have write permission on $gnudir."
echo " Please stop the installation and start it as superuser "
echo " if you want to install the GNU binaries."
echo ""
ask_for_continue:
echo "Continue with installation [y]? " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
goto quit
case [yY]*:
breaksw
default:
goto ask_for_continue
endsw
endif
/bin/rm $gnudir/g_n_u_t_e_s_t >& /dev/null
#################### GNU executables and source packages #########################
set gcc_install = '0'
set gdb_install = '0'
set rcs_install = '0'
set mk_install = '0'
set lib_install = '0'
echo ""
echo ""
echo "=========================================================================="
echo "The media contains executables of the GNU "
echo "C++ compiler (gcc-$gccversion), the library (libg++-$libgversion),"
echo "the debugger (gdb-$gdbversion), the GNU make tool (make-$mk_version)"
echo "and the Revision Control System (rcs-$rcsversion)."
echo ""
echo "The installation of the GNU compiler and debugger is optional."
echo "It is needed only if you do not have any another compiler/debugger."
echo "The installation of the GNU library libg++ is optional."
echo "The installation of the GNU make tool is optional."
echo "The installation of the Revision Control System is optional."
echo "The installation of the GNU library libg++ is optional."
echo "SNiFF+ $SNiFFversion provides an interface to emacs 19 or later."
echo ""
echo "The GNU executables must be installed in the directory $gnudir."
echo "If you do not want to install the ready-to-use GNU executables in $gnudir,"
echo "then you can copy the GNU source packages from any GNU site and build and "
echo "install the GNU tools according to your needs."
if ($no_perm) then
echo ""
echo "WARNING: You cannot install in $gnudir because you do not have"
echo " write permission on it."
echo ""
#goto end_of_get_gnu
endif
############################# GNU gcc ##############################
if (-f $kitroot/$instdir/$nl_gccbin[$iname]) then
set size_gcc = `$gz -l < $kitroot/$instdir/$nl_gccbin[$iname] | fgrep stdout | awk '{printf ("%d", $2/975)}'`
ask_for_gcc:
set c = ""
echo ""
echo "Install executables of gcc-$gccversion in $gnudir ($size_gcc KB)? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
set gcc_install = '0'
breaksw
case [yY]*:
set gcc_install = '1'
breaksw
default:
goto ask_for_gcc
endsw
#
# check existing GNU compiler
#
if ("$gcc_install" == "1") then
if (-d $gnudir/bin) then
set compiler = ($gnudir/bin/[gG][cC][cC]*)
else
set compiler = "no_compiler"
endif
if (-f $compiler[1]) then
echo ""
echo "WARNING:"
echo " GNU compiler $compiler[1] is already installed."
echo ""
$compiler[1] -v
echo ""
echo "Replace it by gcc version $gccversion ? [n] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "n"
if ("$c" == "n" || "$c" == "N" || "$c" == "NO" || "$c" == "no") then
set gcc_install = "0"
endif
endif
endif
endif
############################# GNU libg++ ##############################
if (-f $kitroot/$instdir/$nl_libgarchive[$iname]) then
set size_libg = `$gz -l < $kitroot/$instdir/$nl_libgarchive[$iname] | fgrep stdout | awk '{printf ("%d", $2/975)}'`
ask_for_lib:
set c = ""
echo ""
echo "Install libg++-$libgversion in $gnudir ($size_libg KB)? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
set lib_install = '0'
breaksw
case [yY]*:
set lib_install = '1'
breaksw
default:
goto ask_for_lib
endsw
#
# check existing GNU library
#
if ("$lib_install" == "1") then
if (-d $gnudir/lib) then
set library = ($gnudir/lib/libg++*.a)
else
set library = "no_compiler"
endif
if (-f $library[1]) then
echo ""
echo "WARNING:"
echo " GNU library $library[1] is already installed."
echo ""
echo "Replace it by libg++ version $libgversion ? [n] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "n"
if ("$c" == "n" || "$c" == "N" || "$c" == "NO" || "$c" == "no") then
set lib_install = "0"
endif
endif
endif
endif
############################# GNU gdb ##############################
if (-f $kitroot/$instdir/$nl_gdbbin[$iname]) then
set size_gdb = `$gz -l < $kitroot/$instdir/$nl_gdbbin[$iname] | fgrep stdout | awk '{printf ("%d", $2/975)}'`
ask_for_gdb:
set c = ""
echo ""
echo "Install executables of gdb-$gdbversion in $gnudir ($size_gdb KB)? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
set gdb_install = '0'
breaksw
case [yY]*:
set gdb_install = '1'
breaksw
default:
goto ask_for_gdb
endsw
#
# check existing GNU debugger
#
if ("$gdb_install" == "1") then
if (-d $gnudir/bin) then
set debugger = ($gnudir/bin/[gG][dD][bB]*)
else
set debugger = "no_debugger"
endif
if (-f $debugger[1]) then
echo ""
echo "WARNING:"
echo " GNU debugger $debugger[1] is already installed."
echo ""
$debugger[1] -help | & sed '2,$d'
echo ""
echo "Replace it by gdb version $gdbversion ? [n] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "n"
if ("$c" == "n" || "$c" == "N" || "$c" == "NO" || "$c" == "no") then
set gdb_install = "0"
endif
endif
endif
endif
############################# GNU rcs ##############################
if (-f $kitroot/$instdir/$nl_rcsbin[$iname]) then
set size_rcs = `$gz -l < $kitroot/$instdir/$nl_rcsbin[$iname] | fgrep stdout | awk '{printf ("%d", $2/975)}'`
ask_for_rcs:
set c = ""
echo ""
echo "Install executables of rcs-$rcsversion in $gnudir ($size_rcs KB)? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
set rcs_install = '0'
breaksw
case [yY]*:
set rcs_install = '1'
breaksw
default:
goto ask_for_rcs
endsw
#
# check existing RCS
#
if ("$rcs_install" == "1") then
if (-d $gnudir/bin) then
set rcs = ($gnudir/bin/rcs*)
else
set rcs = "no_rcs"
endif
if (-f $rcs[1]) then
echo ""
echo "WARNING:"
echo " RCS is already installed."
echo ""
echo "Replace it by rcs version $rcsversion ? [n] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "n"
if ("$c" == "n" || "$c" == "N" || "$c" == "NO" || "$c" == "no") then
set rcs_install = "0"
endif
endif
endif
endif
############################# GNU make ##############################
if (-f $kitroot/$instdir/$nl_mk_bin[$iname]) then
set size_mk = `$gz -l < $kitroot/$instdir/$nl_mk_bin[$iname] | fgrep stdout | awk '{printf ("%d", $2/975)}'`
ask_for_mk:
set c = ""
echo ""
echo "Install executables of make-$mk_version in $gnudir ($size_mk KB)? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
set mk_install = '0'
breaksw
case [yY]*:
set mk_install = '1'
breaksw
default:
goto ask_for_mk
endsw
#
# check existing MAKE
#
if ("$mk_install" == "1") then
if (-d $gnudir/bin) then
set mk = ($gnudir/bin/*make)
else
set mk = ""
endif
if ("$mk" != "") then
echo ""
echo "WARNING:"
echo " GNU make is already installed."
# does not work with all make programms
# $mk[0] -v
echo ""
echo "Replace it by make version $mk_version ? [n] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "n"
if ("$c" == "n" || "$c" == "N" || "$c" == "NO" || "$c" == "no") then
set mk_install = "0"
endif
endif
endif
endif
end_of_get_gnu:
############################# JDK ##############################
set jdk_install = '0'
set jdkdir = $HOME
set size_jdk = 0
if (-f $kitroot/$nl_jdkdir[$iname]/$instdir/$nl_jdk[$iname]) then
echo ""
echo "=========================================================================="
echo "The media contains JDK for $inst_arch"
echo ""
echo "The installation of the JDK is optional."
echo "It is needed only if you are working with JAVA."
echo ""
set size_jdk = `$gz -l < $kitroot/$nl_jdkdir[$iname]/$instdir/$nl_jdk[$iname] | fgrep stdout | awk '{printf ("%d", $2/975)}'`
set c = ""
echo ""
echo "Install JDK for $inst_arch ($size_jdk KB)? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
set jdk_install = '0'
breaksw
case [yY]*:
set jdk_install = '1'
get_jdkdir:
echo ""
echo 'Please enter the absolute pathname of the JDK install directory: ' | awk ' { printf "%s", $0 }'
set jdkdir = `/bin/sh -c 'read a; echo $a'`
echo ""
if ("$jdkdir" == "") then
echo "You must specify the directory where JDK is to be located."
goto get_jdkdir
endif
if ( `echo $jdkdir | awk '{printf "%s",substr($1,1,1)}'` != "/" ) then
echo ""
echo "Please enter an absolute pathname like /usr/SNiFF ..."
goto get_jdkdir
endif
echo ""
echo "Install JDK in directory $jdkdir? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
goto get_jdkdir
endsw
if ( "$jdkdir" == "/" ) then
# some shells dont like it
set tmpjdkdir = '/.'
else
set tmpjdkdir = $jdkdir
endif
if ( !(-d $tmpjdkdir) ) then
echo "$jdkdir does not exist. Would you like to create it? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
goto get_jdkdir
default:
mkdir -p $jdkdir
chmod 755 $jdkdir
if (!(-d $jdkdir)) then
echo "Could not create $jdkdir (maybe missing permission?), please try again."
goto quit
endif
endsw
endif
#
# check write permission on jdkdir
#
touch $jdkdir/t_e_s_t >& /dev/null
if ( !(-f $jdkdir/t_e_s_t) ) then
echo ""
echo "You do not have write permission on $jdkdir."
echo ""
goto get_jdkdir
endif
/bin/rm $jdkdir/t_e_s_t >& /dev/null
breaksw
default:
endsw
endif
end_of_get_jdk:
#
# check size
#
@ sumMBgnu = $gcc_install * $size_gcc
@ sumMBgnu = $sumMBgnu + $lib_install * $size_libg + $gdb_install * $size_gdb
@ sumMBgnu = $sumMBgnu + $mk_install * $size_mk + $rcs_install * $size_rcs
@ sumMBjdk = $jdk_install * $size_jdk
@ sumMB = $sumMBgnu + $sumMBjdk
if ($sumMB == 0) then
goto quit
endif
@ sumMBgnu = ($sumMBgnu + 512) / 1024
@ sumMBjdk = ($sumMBjdk + 512) / 1024
echo ""
echo ""
echo "=========================================================================="
echo "The following packages are selected for installation:"
echo ""
if ($gcc_install) then
echo " executables of gcc-$gccversion ($size_gcc KB)"
endif
if ($lib_install) then
echo " archive file of libg++-$libgversion ($size_libg KB)"
endif
if ($gdb_install) then
echo " executables of gdb-$gdbversion ($size_gdb KB)"
endif
if ($rcs_install) then
echo " executables of rcs-$rcsversion ($size_rcs KB)"
endif
if ($mk_install) then
echo " executables of make-$mk_version ($size_mk KB)"
endif
if ($jdk_install) then
echo " Java Development Kit ($size_jdk KB)"
endif
echo ""
echo "=========================================================================="
if ($sumMBgnu != 0) echo "$sumMBgnu MB to be installed in $gnudir"
if ($sumMBjdk != 0) echo "$sumMBjdk MB to be installed in $jdkdir"
ask_for_install:
set c = ""
echo ""
echo "Continue with installation of the packages listed above? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
goto quit
breaksw
case [yY]*:
breaksw
default:
goto ask_for_install
endsw
if ($selection == 1) goto install_sniff
#
# check if gnudir does exist
#
if ((("$gcc_install" == "1") || ("$lib_install" == "1") || ("$gdb_install" == "1") || ("$rcs_install" == "1") || ("$mk_install" == "1")) && !(-d $gnudir)) then
echo ""
echo "$gnudir does not exist."
echo "Would you like to create it? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
if ("$c" == "y" || "$c" == "Y" || "$c" == "YES" || "$c" == "yes") then
mkdir -p $gnudir
chmod a+rx $gnudir
if (!(-d $gnudir)) then
set gcc_install = '0'
set gdb_install = '0'
set rcs_install = '0'
set mk_install = '0'
set lib_install = '0'
echo ""
echo "Could not create $gnudir."
echo "Skipping installation of selected GNU packages."
endif
else
set gcc_install = '0'
set gdb_install = '0'
set rcs_install = '0'
set mk_install = '0'
set lib_install = '0'
echo ""
echo "Directory $gnudir not created."
echo "Skipping installation of selected GNU packages."
endif
endif
#
# Install GNU and JDK
#
if ($gcc_install) then
cd $gnudir
echo "Installing executables of gcc-$gccversion in $gnudir ..."
$gz -d -c < $kitroot/$instdir/$nl_gccbin[$iname] | cat | $gtar -xopf - > /dev/null
# echo "Fixing standard system include files for gcc (takes 10 minutes or more) ..."
# sh ./fixincludes >& /dev/null
endif
if ($lib_install) then
cd $gnudir
echo "Installing libg++-$libgversion in $gnudir ..."
$gz -d -c < $kitroot/$instdir/$nl_libgarchive[$iname] | cat | $gtar -xopf - > /dev/null
endif
if ($gdb_install) then
cd $gnudir
echo "Installing gdb-$gdbversion in $gnudir ..."
$gz -d -c < $kitroot/$instdir/$nl_gdbbin[$iname] | cat | $gtar -xopf - > /dev/null
endif
if ($rcs_install) then
cd $gnudir
echo "Installing rcs-$rcsversion in $gnudir ..."
$gz -d -c < $kitroot/$instdir/$nl_rcsbin[$iname] | cat | $gtar -xopf - > /dev/null
endif
if ($mk_install) then
cd $gnudir
echo "Installing make-$mk_version in $gnudir ..."
$gz -d -c < $kitroot/$instdir/$nl_mk_bin[$iname] | cat | $gtar -xopf - > /dev/null
endif
if ($jdk_install) then
cd $jdkdir
echo "Installing JDK for $inst_arch in $jdkdir ..."
$gz -d -c < $kitroot/$nl_jdkdir[$iname]/$instdir/$nl_jdk[$iname] | cat | $gtar -xopf - > /dev/null
endif
if (! ($gcc_install || $gdb_install || $rcs_install || $mk_install || $lib_install) ) goto endinstall
if ( ${?rootdir} ) then
if ( "$rootdir" != "" ) then
set sniffdir = $rootdir
goto end_gnuinstall
endif
endif
get_sniffdir:
echo ""
echo "The GNU public license text files will be copied to <sniff_dir>/gnu."
echo 'Please enter the absolute pathname of your SNiFF+ installation directory:'
get_sniffdir2:
echo ""
echo '> ' | awk ' { printf "%s", $0 }'
set sniffdir = `/bin/sh -c 'read a; echo $a'`
echo ""
if ("$sniffdir" == "") then
echo "You must specify the directory to copy the files."
goto get_sniffdir2
endif
if ( `echo $sniffdir | awk '{printf "%s",substr($1,1,1)}'` != "/" ) then
echo "Please enter an absolute pathname like /usr/SNiFF ..."
goto get_sniffdir2
endif
end_gnuinstall:
if (! -d $sniffdir/gnu) then
mkdir $sniffdir/gnu >& /dev/null
endif
if ($gcc_install || $gdb_install || $rcs_install || $mk_install) then
cp $kitroot/$nl_copy[$iname] $sniffdir/gnu/COPYING >& /dev/null
endif
if ($lib_install) then
cp $kitroot/$nl_copylib[$iname] $sniffdir/gnu/COPYING.LIB >& /dev/null
endif
if (-f $gnudir/bin/as.PTF-U416277) then
echo ""
echo "======================================================================"
echo "NOTE: There is a bug in the IBM assembler under some AIX versions."
echo " Please check your assembler whether the bug is fixed."
echo " The file $gnudir/README.gcc discribes how to test the assembler."
echo " Please read also the Release Notes."
echo " There is a fixed version of the assembler included on the SNiFF+ media."
echo " Please make a backup copy of /bin/as and"
echo " replace it with $gnudir/bin/as.PTF-U416277,"
echo " if your assembler does not include the fix."
echo "======================================================================"
endif
goto endinstall
#
install_flexlm:
#
# ask for FlexLM installation directory
#
get_flexdir:
echo ""
echo 'Please enter the absolute pathname of the FlexLM root directory:'
echo ""
echo '> ' | awk ' { printf "%s", $0 }'
set flexdir = `/bin/sh -c 'read a; echo $a'`
echo ""
if ("$flexdir" == "") then
echo "You must specify the directory where FlexLM is to be located."
goto get_flexdir
endif
if ( `echo $flexdir | awk '{printf "%s",substr($1,1,1)}'` != "/" ) then
echo "Please enter an absolute pathname like /usr/flexlm ..."
goto get_flexdir
endif
echo "Install FlexLM in directory $flexdir? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
goto get_flexdir
endsw
if ( "$flexdir" == "/" ) then
# some shells dont like it
set tmpflexdir = '/.'
else
set tmpflexdir = $flexdir
endif
if ( !(-d $tmpflexdir) ) then
echo "$flexdir does not exist. Would you like to create it? [y] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN]*:
goto get_flexdir
default:
mkdir -p $flexdir
chmod 755 $flexdir
if (!(-d $flexdir)) then
echo "Could not create $flexdir (maybe missing permission?), please try again."
goto quit
endif
endsw
endif
#
# check write permission on flexdir
#
touch $flexdir/t_e_s_t >& /dev/null
if ( !(-f $flexdir/t_e_s_t) ) then
echo ""
echo "You do not have write permission on $flexdir."
echo ""
goto quit
endif
/bin/rm $flexdir/t_e_s_t >& /dev/null
set flex_paths = ()
foreach flex_file ($flex_files)
set flex_paths = ($flex_paths "bin/bin.$kit_arch/$flex_file")
end
if (-f $flexdir/bin/lmutil) then
echo "FlexLM is already installed in $flexdir"
echo "Would you like to overwrite the installation? [n] " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "n"
switch("$c")
case [nN]*:
goto quit
case [yY]*:
cd $flexdir/bin
/bin/rm -f $flex_files
breaksw
endsw
endif
# unpack flexlm files
cd $flexdir
$gz -d -c < $kitroot/$kitdir/$nl_sniffbin[$iname] | cat | $gtar -xopf - $flex_paths > /dev/null
# move files to bin directory and remove architecture directory
mv bin/bin.$kit_arch/* bin >& /dev/null
rmdir bin/bin.$kit_arch >& /dev/null
echo ""
echo "FlexLM has been successfully installed to $flexdir"
goto end
#
install_sniff:
############################ Install packages #################################
#
#
# write temporary script
# deletes read-only files and symbolic links
while ( ( -e $tmp_script ) || { sh -c "test -h $tmp_script" } )
set tmp_script = $tmp_script"_"
end
echo '#\!/bin/sh' > $tmp_script
echo 'if [ ! -w $1 ]; then rm -fr $1 > /dev/null; exit 0; fi' >> $tmp_script
echo 'if [ -h $1 ]; then rm -fr $1 > /dev/null; fi' >> $tmp_script
echo 'exit 0' >> $tmp_script
chmod 755 $tmp_script
#umask 0
echo ""
cd $rootdir
echo ""
echo "Installing the selected packages."
echo "This may take several minutes for each package."
echo ""
if ( $common_install ) then
#
# checking some files for presence, and copy them to *.old
#
if ( -f $rootdir/Version ) then
if ( -f $rootdir/bin/sniff_wrapper ) then
chmod 666 $rootdir/bin/sniff_wrapper >& /dev/null
endif
if ( -f $rootdir/Version ) then
chmod 666 $rootdir/Version >& /dev/null
endif
set files_to_move = ( "Version" "SitePrefs.sniff" "license.dat" )
set dirs_to_move = ( doc config icons lib make_support ws_support \
Preferences integrations symbol_API )
echo copying and moving some files, directories of the old version
foreach file ($files_to_move)
if ( -f $rootdir/$file ) then
if ( -f $rootdir/$file.old ) then
echo first removing $file.old
rm -f $rootdir/$file.old
endif
echo copying $file to $file.old
cp $rootdir/$file $rootdir/$file.old
chmod 666 $rootdir/$file >& /dev/null
endif
end # foreach file
#
# moving common existing sniff dirs to *.old
#
foreach dir ($dirs_to_move)
if ( -d $rootdir/$dir ) then
if ( -d $rootdir/$dir.old ) then
echo current $dir.old will be overwritten
rm -f -r $rootdir/$dir.old
endif
echo moving directory $dir to $dir.old
mv -f $rootdir/$dir $rootdir/$dir.old
endif
end # foreach dir
echo ""
endif
echo "Installing common SNiFF+ $SNiFFversion ..."
if ( $common_overwrite ) then
# moving old workingenvs dir - will be restored afterwards
mv $rootdir/workingenvs $rootdir/workingenvs.old
$gz -d -c < $kitroot/$nl_sniffcommon[$iname] | cat | $gtar -tf - | awk '{print $1}' | xargs -i $tmp_script {}
endif
$gz -d -c < $kitroot/$nl_sniffcommon[$iname] | cat | $gtar -xopf - > /dev/null
chmod 777 $rootdir/workingenvs/WEProjectCache >& /dev/null
if ( $common_overwrite ) then
mv $rootdir/workingenvs $rootdir/workingenvs.orig
mv $rootdir/workingenvs.old $rootdir/workingenvs
endif
endif
cd $rootdir
if ($doc_install) then
echo "Copying SNiFF+ documentation into $rootdir/doc ..."
mkdir doc >& /dev/null
chmod 755 doc
cd doc
$gz -d -c < $kitroot/$nl_docfiles[$iname]| cat | $gtar -xopf - > /dev/null
endif
cd $rootdir
if ($exa_install) then
echo "Installing Example sources for the tutorials including ET++ in $rootdir/example ..."
if ($exa_install == 2) then
rm -fr $rootdir/example >& /dev/null
endif
$gz -d -c < $kitroot/$nl_examples[$iname] | cat | $gtar -xopf - > /dev/null
chmod 777 $rootdir/example
endif
cd $rootdir
if ($visaj_install) then
echo "Installing VisaJ GUI Builder in $rootdir/$visajdir ..."
if ($visaj_install == 2) then
rm -fr $rootdir/$visajdir >& /dev/null
endif
$gz -d -c < $kitroot/$nl_visaj[$iname] | cat | $gtar -xopf - > /dev/null
chmod 755 $rootdir/$visajdir
endif
set vim_installed = 0
if ( -d $rootdir/config/vim ) then
set vim_installed = 1
endif
foreach iarch ($iarchs)
set bin_install = $l_bin_install[$iarch]
set vim_bin_install = $l_vim_bin_install[$iarch]
set kitdir = $kitdirs[$iarch]
set kit_arch = $kit_archs[$iarch]
if ($bin_install) then
cd $rootdir
echo "Installing binaries of SNiFF+ $SNiFFversion for $kit_arch ..."
if ($bin_install == 2) then
$gz -d -c < $kitroot/$kitdir/$nl_sniffbin[$iname] | cat | $gtar -tf - | awk '{print $1}' | xargs -i $tmp_script {}
endif
$gz -d -c < $kitroot/$kitdir/$nl_sniffbin[$iname] | cat | $gtar -xopf - > /dev/null
# if ( -f $kitroot/$kitdir/$nl_tar[$iname] ) then
# cp $kitroot/$kitdir/$nl_tar[$iname] bin/tar
# chmod 755 bin/tar
# endif
endif
if ($vim_bin_install) then
cd $rootdir
echo "Installing Vim 5.0 binaries for $kit_arch ..."
if ($vim_bin_install == 2 || $vim_installed) then
$gz -d -c < $kitroot/$kitdir/$nl_vimbin[$iname] | cat | $gtar -tf - | awk '{print $1}' | xargs -i $tmp_script {}
endif
$gz -d -c < $kitroot/$kitdir/$nl_vimbin[$iname] | cat | $gtar -xopf - > /dev/null
set vim_installed = 1
endif
end # foreach iarch
if ( -f $tmp_script ) then
/bin/rm -f $tmp_script
endif
#
# change permissions to read-only
#
if ($common_install) then
chmod 755 $rootdir/bin
chmod 444 $rootdir/Version
chmod 555 $rootdir/bin/sniff_wrapper
endif
if ("$user" != "root") then
goto endinstall
endif
while ( ( -e $tmperr ) || { sh -c "test -h $tmperr" } )
set tmperr = $tmperr"_"
end
echo ""
echo "Please enter the login name or user ID of the user who should be the owner"
echo "of the current SNiFF+ installation."
get_owner:
echo ""
echo "Login name/user ID? " | awk ' { printf "%s", $0 }'
set us = `/bin/sh -c 'read a; echo $a'`
if ( "$us" != "" ) then
echo ""
echo "Changing owner to '$us' ..."
# check before recursive call
chown $us $rootdir/. >& $tmperr
if ($status != 0) then # error: no permission, wrong uid, etc.
cat $tmperr
echo "Cannot change owner to '$us'"
goto get_owner
endif
# for those systems that have chown -h
find $rootdir -type l -exec chown -h $us {} \; >& /dev/null
find $rootdir ! -type l -exec chown $us {} \; > /dev/null
if ($status == 0) then
echo "Owner changed."
else
echo "Cannot change owner to '$us'"
goto get_owner
endif
else
echo "Owner not changed."
endif
echo ""
echo "Please enter the group name or group ID which should be applied to"
echo "the current SNiFF+ installation."
get_group:
echo ""
echo "Group name/ID? " | awk ' { printf "%s", $0 }'
set grp = `/bin/sh -c 'read a; echo $a'`
if ( "$grp" != "" ) then
echo ""
echo "Changing group to '$grp' ..."
chgrp $grp $rootdir/. >& $tmperr
if ($status != 0) then # error: no permission, wrong gid, etc.
cat $tmperr
echo "Cannot change group to '$grp'"
goto get_group
endif
find $rootdir -type l -exec chgrp -h $grp {} \; >& /dev/null
find $rootdir ! -type l -exec chgrp $grp {} \; > /dev/null
if ($status == 0) then
echo "Group changed."
else
echo "Cannot change group to '$grp'"
goto get_group
endif
else
echo "Group not changed."
endif
/bin/rm -f $tmperr >& /dev/null
endinstall:
if ( "$gname" == "4" ) then
rm /tmp/$nl_zcat[$gname] >& /dev/null
rm /tmp/$nl_tar[$gname] >& /dev/null
endif
if ($selection == 2) goto end
set license_entered = 0
if ($bin_install) then
# ask for license string
echo ""
echo "It is possible to enter the license now, line by line,"
echo "or later, by editing the file $rootdir/license.dat."
echo ""
echo "Note: If you don't have an evaluation or permanent license"
echo " key you are using 'Personal SNiFF+'."
echo " Personal SNiFF+ is licensed for non-commercial use and evaluations"
echo " only. Commercial use is prohibited. While using Personal SNiFF+,"
echo " project size is limited to 200 files. In addition, remote development"
echo " capabilities and code generation from the GUI builder are disabled."
echo " Please contact TakeFive Software at <http://www.takefive.com/>"
echo " if you would like to receive a free unlimited-use evaluation key"
echo " or to purchase a permanent license key for commercial use."
echo " For details, please see the end-user license agreement."
echo ""
echo "Would you like to enter your license string(s) now [y]? " | awk '{printf "%s", $0}'
ask_license_again:
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch ("$c")
case [nN*]:
goto ask_for_install_check
default:
if (! $license_entered) then
echo ""
echo "Example of a product license:"
echo "SERVER test1 5542257a 7594"
echo "DAEMON takefive <sniff_dir>/bin "
echo 'FEATURE SNiFF takefive 3.000 01-jan-00 4 FCBB0CA81DB2B47A821FD ""'
echo ""
echo "Example of an evaluation license:"
echo 'FEATURE SNiFF_EVAL none 3.000 31-Jan-1999 0 CCD3E651C5AD41BD4BF1 "" DEMO'
endif
endsw
set license_entered = 1
ask_for_license:
echo ""
echo "Your license string (you have to enter product licenses line by line): "
set license = `/bin/sh -c 'read a; echo $a'`
switch ("$license")
case SERVER*:
set linepat = 'SERVER'
breaksw
case DAEMON*:
set linepat = 'DAEMON'
breaksw
case *DEMO:
set linepat = 'DEMO'
breaksw
case FEATURE*:
set linepat = 'FEATURE'
breaksw
default:
echo ""
echo "The license string seems to be incorrect. Please retry."
goto ask_license_again
endsw
echo ""
echo "Please confirm your input: "
echo ""
echo "$license"
echo ""
echo "Is the string correct [y]? " | awk '{printf "%s", $0}'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [nN*]:
goto ask_for_license
default:
endsw
# determine line number where to insert string
set line = (`sed -n -e "/$linepat/=" "$rootdir/license.dat"`)
if ("$line" == "") then
set line = 1
else
set line = $line[$#line]
endif
@ line2 = $line + 1
head -$line2 $rootdir/license.dat >! $rootdir/license.dat.new
echo "$license" >> $rootdir/license.dat.new
tail +$line $rootdir/license.dat >> $rootdir/license.dat.new
/bin/rm -f $rootdir/license.dat
mv -f $rootdir/license.dat.new $rootdir/license.dat
echo ""
echo "The license string has been added to $rootdir/license.dat"
echo ""
echo "Would you like to enter another license string [y]? " | awk '{printf "%s", $0}'
goto ask_license_again
endif
# ask for install.check
ask_for_install_check:
echo ""
echo "Run automatic installation check [y]? " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "y"
switch("$c")
case [yY]*:
$rootdir/bin/install.check $rootdir
breaksw
default:
endsw
echo ""
ask_for_continue_install:
echo "Continue with installation of other packages [n] ? " | awk ' { printf "%s", $0 }'
set c = `/bin/sh -c 'read a; echo $a'`
if ("$c" == "") set c = "n"
switch("$c")
case [nN]*:
goto end
case [yY]*:
goto start_install
default:
goto ask_for_continue_install
endsw
end:
echo ""
echo "Installation complete."
if ($bin_install) then
echo ""
echo "Please continue installation by setting the necessary environment"
echo '(Chapter "Setting the environment variables" of the "Installation Guide").'
echo ""
endif
exit 0
quit:
echo ""
echo "Installation terminated."
exit 1